import wtforms

from validators import BaseForm, BasePageForm


class VisLogForm(BaseForm):
    """
    系统访问日志表表单校验类
    """
    id = wtforms.IntegerField()
    name = wtforms.StringField("名称")
    success = wtforms.StringField("是否执行成功（Y-是，N-否）")
    message = wtforms.StringField("具体消息")
    ip = wtforms.StringField("ip")
    location = wtforms.StringField("地址")
    browser = wtforms.StringField("浏览器")
    os = wtforms.StringField("操作系统")
    visType = wtforms.StringField("操作类型（字典 1登入 2登出）", [wtforms.validators.DataRequired(message="操作类型（字典 1登入 2登出）不能为空")])
    visTime = wtforms.StringField("访问时间")
    account = wtforms.StringField("访问账号")
    signValue = wtforms.StringField("签名数据（除ID外）")


class VisLogPageForm(BasePageForm):
    """
    系统访问日志表分页校验类
    """
    pass
